package com.zjjk.transfer.app;

import com.zjjk.transfer.source.entity.SourceDishMeal;
import com.zjjk.transfer.source.service.SourceDishMealService;
import com.zjjk.transfer.target.entity.TargetDishCategory;
import com.zjjk.transfer.target.service.TargetDishCategoryService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

@Component
public class DishCategoryTransfer extends BaseTransfer<SourceDishMeal, TargetDishCategory, SourceDishMealService, TargetDishCategoryService> {


    @Override
    protected TargetDishCategory convert(SourceDishMeal source) {
        TargetDishCategory target = new TargetDishCategory();
        BeanUtils.copyProperties(source,target);
        target.setId(Long.valueOf(source.getId()));
        return target;
    }
}
